#!/bin/sh
echo skip over F00.boot
dd if=/dev/nrmt0h bs=512 of=/dev/null

echo skip over F01.vmunix
dd if=/dev/nrmt0h bs=512 of=/dev/null

echo skip over f02.root.dump
dd if=/dev/nrmt0h bs=10240 of=/dev/null

echo read in f03.instctrl.tar
dd if=/dev/nrmt0h bs=10240 of=/tmp/instctrl.tar
tar tf /tmp/instctrl.tar | egrep '.inv$' | sed -e 's/.inv$//' | grep -n .
mkdir ./usr/etc ./usr/etc/subsets
(cd ./usr/etc/subsets ; tar xf /tmp/instctrl.tar)

i=1

while true
do
    echo "extract subset $i? [ynq]"
    read line
    [ $line = y ] && dd if=/dev/nrmt0h bs=10240 | zcat | tar xf -
    [ $line = n ] && dd if=/dev/nrmt0h bs=10240 of=/dev/null
    [ $line = q ] &&
    {
	mt -f /dev/rmt0h rew
	exit
    }

    i=`expr $i + 1`
done

